<template>
	<view class="bg-color">
		<view class="cu-list menu">
			<view class="cu-item bg-color">
				<view class="content">
					<text class="text-color">产品报价</text>
				</view>
			</view>
		</view>
		<view class="padding">
			<view class="grid col-4 grid-square">
				<view @click="toProducts(item.categoryId)" class="b-item" v-for="(item,index) in carBrands" :key="index">
					<image mode="widthFix" :src="'https://'+item.imageUrl"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data: function() {
			return {
				carBrands: []
			}
		},
		created: function() {
			this.loadBaseInfo();
		},
		methods: {
			toProducts: function(categoryId) {
				console.log(categoryId);
				uni.navigateTo({
					url: "../pages/price/list?categoryId="+categoryId
				});
			},
			loadBaseInfo: function() {
				this.http.get({
					url: "/category/sub",
					param: {
						categoryId: 0
					}
				}).then(res => {
					console.log(res);
					this.carBrands = res;
				});
			}
		}
	}
</script>

<style>
	.b-item {
		
	}
	.cu-list .cu-item {
		border-bottom: 3rpx solid #FFFFFF;
	}
</style>
